﻿namespace Jim.OA;

/// <summary>
/// 流程高级查询条件
/// </summary>
public class OAWorkFlowCondition
{
    [JsonProperty("wfcode")]
    public string WfCode { get; set; }
    [JsonProperty("ownerdepartmentid")]
    public string OwnerDepartmentId { get; set; }
    [JsonProperty("requestname")]
    public string RequestName { get; set; }
    [JsonProperty("nodetype")]
    public string NodeType { get; set; }
    [JsonProperty("workcode")]
    public string workcode { get; set; }
    [JsonProperty("archivestatus")]
    public string ArchiveStatus { get; set; }
    [JsonProperty("operatedateselect")]
    public string OperateDateSelect { get; set; }
    [JsonProperty("recievedateselect")]
    public string RecieveDateSelect { get; set; }
    [JsonProperty("creatersubcompanyid")]
    public string CreaterSubCompanyId { get; set; }
    [JsonProperty("requestlevel")]
    public string RequestLlevel { get; set; }
    [JsonProperty("unophrmid")]
    public string UnophrmId { get; set; }
    [JsonProperty("docids")]
    public string DocIds { get; set; }
    [JsonProperty("creatertype")]
    public string CreaterType { get; set; }
    [JsonProperty("proids")]
    public string ProIds { get; set; }
    [JsonProperty("crmids")]
    public string CrmIds { get; set; }
    [JsonProperty("craterid")]
    public string Craterid { get; set; }
    [JsonProperty("hrmcreaterid")]
    public string CreaterId { get; set; }
    [JsonProperty("createdateselect")]
    public string CreateDateSelect { get; set; }
}




/// <summary>
/// 流程查询返回信息
/// </summary>
public class OAWorkFlowRequestBase
{
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }
    /// <summary>
    /// 创建人id
    /// </summary>
    public string CreatorId { get; set; }
    /// <summary>
    /// 创建人姓名
    /// </summary>
    public string creatorName { get; set; }
    /// <summary>
    /// 当前节点id
    /// </summary>
    public string currentNodeId { get; set; }
    /// <summary>
    /// 当前节点名称
    /// </summary>
    public string currentNodeName { get; set; }
    /// <summary>
    /// 最后操作时间
    /// </summary>
    public DateTime lastOperateTime { get; set; }
    /// <summary>
    /// 最后操作人id
    /// </summary>
    public string lastOperatorId { get; set; }
    /// <summary>
    /// 最后操作人名称
    /// </summary>
    public string lastOperatorName { get; set; }
    /// <summary>
    /// 接收时间
    /// </summary>
    public string ReceiveTime { get; set; }
    /// <summary>
    /// 请求id
    /// </summary>
    public string requestId { get; set; }
    /// <summary>
    /// 紧急程度
    /// </summary>
    public string requestLevel { get; set; }
    /// <summary>
    /// 请求名称
    /// </summary>
    public string requestName { get; set; }
    /// <summary>
    /// 流程状态
    /// </summary>
    public string status { get; set; }
    /// <summary>
    /// 系统名称
    /// </summary>
    public string sysName { get; set; }
    /// <summary>
    /// 流程基本信息
    /// </summary>
    public OAWorkflowBaseInfo workflowBaseInfo { get; set; }

}

public class OAWorkflowBaseInfo
{
    /// <summary>
    /// 表单id
    /// </summary>
    public string FormId { get; set; }
    /// <summary>
    /// 流程id
    /// </summary>
    public string WorkflowId { get; set; }
    /// <summary>
    /// 流程名称
    /// </summary>
    public string WorkflowName { get; set; }
    /// <summary>
    /// 流程类型id
    /// </summary>
    public string WorkflowTypeId { get; set; }
    /// <summary>
    /// 流程类型名称
    /// </summary>
    public string WorkflowTypeName { get; set; }
}



public class OAGetRequestCountInput : OAUserRequest<OAGetRequestCountOutput>, ISdkCustomDic
{
    public OAWorkFlowCondition Conditions { get; set; }
    /// <summary>
    /// 是否主次账号统一显示
    /// </summary>
    ///<example>true</example>
    public string IsMergeShow { get; set; } = "true";
    /// <summary>
    /// 是否显示异构系统数据 ， 为true时还需 设置开启异构系统显示才会显示
    /// </summary>
    ///<example>true</example>
    public string IsNeedOs { get; set; } = "true";

    public virtual SdkDictionary Dic()
    {
        SdkDictionary dic = new SdkDictionary();
        dic.Add("conditions", Conditions);
        if (!string.IsNullOrEmpty(IsMergeShow)) dic.Add("isMergeShow", IsMergeShow);
        if (!string.IsNullOrEmpty(IsNeedOs)) dic.Add("isNeedOs", value: IsNeedOs);
        return dic;
    }
}


public class OAGetRequestListInput: OAUserRequest<OAGetRequestListOutput>,ISdkCustomDic 
{
    public OAWorkFlowCondition Conditions { get; set; }

    /// <summary>
    /// 是否主次账号统一显示
    /// </summary>
    ///<example>true</example>
    public string IsMergeShow { get; set; } = "true";
    /// <summary>
    /// 是否显示异构系统数据 ， 为true时还需 设置开启异构系统显示才会显示
    /// </summary>
    ///<example>true</example>
    public string IsNeedOs { get; set; } = "true";
    /// <summary>
    /// 要查询的为第几页的数据
    /// </summary>
    ///<example>1</example>
    public string PageNo { get; set; } = "1";
    /// <summary>
    /// 分页时一页多少数据
    /// </summary>
    ///<example>10</example>
    public string PageSize { get; set; } = "10";

    public virtual SdkDictionary Dic()
    {
        SdkDictionary dic = new SdkDictionary();
        dic.Add("conditions", Conditions);
        if (!string.IsNullOrEmpty(IsMergeShow)) dic.Add("isMergeShow", IsMergeShow);
        if (!string.IsNullOrEmpty(IsNeedOs)) dic.Add("isNeedOs", IsNeedOs);
        if (!string.IsNullOrEmpty(PageNo)) dic.Add("pageNo", PageNo);
        if (!string.IsNullOrEmpty(PageSize)) dic.Add("pageSize", PageSize);
        return dic;
    }
}


/// <summary>
/// 流程数量通用返回
/// </summary>
public class OAGetRequestCountOutput:SdkResponse<int>{ }

/// <summary>
/// 流程列表通用返回
/// </summary>
public class OAGetRequestListOutput : SdkResponse<List<OAWorkFlowRequestBase>> { }